package Com.Hupochuan.Dal.Tab;

import java.util.Hashtable;
import java.util.List;
import java.util.Vector;

import Com.Hupochuan.Dal.DBManager.DBManager;
import Com.Hupochuan.Vo.Year;

public class YearTab {
	/*
	 * 本类私有对象
	 */
	private DBManager<Year> dbManager = new DBManager<Year>(Year.class);
	
	/*
	 * 单一实例
	 */
	private YearTab(){}
	private static YearTab yearTab = new YearTab();
	public static YearTab getObject(){
		return yearTab;
	}
	
	/*
	 * 查询年份列表
	 */
	public List<Year> findYearList(){
		
		//参数部分
		List<Year> yearList = new Vector<Year>();
		StringBuffer sqlBuff = new StringBuffer();
		Hashtable<String,Object> paraHash = new Hashtable<String,Object>();
		
		//sql语句部分
		sqlBuff.append(" select * from Year order by weight desc,id ");
		
		//执行sql 
		yearList = this.dbManager.querySqlReturnVoList(sqlBuff.toString(),paraHash);
		
		//返回列表
		return yearList;
	}
}
